﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;

namespace PSE.Deployment.TeamFoundation.Entity.Enum
{
    public enum WorkItemType
    {
        [Description("HotFix")]
        HotFix,
        [Description("ServicePack")]
        ServicePack
    }

    public static class WorkItemTypeExtend
    {
        public static string ToText(this WorkItemType workItemType)
        {
            System.Type type = typeof(WorkItemType);
            System.Object[] attributes = type.GetCustomAttributes(typeof(DescriptionAttribute), true);
            return (attributes.Length > 0) ? attributes[0].ToString() : "Não definido.";
        }
    }
}
